#define  _CRT_SECURE_NO_WARNINGS


#include<stdio.h>
#include<string.h>



int main()
{
    char a[100] = { 0 }, b[100] = { 0 }, temp[] = "abcdefghijklmnopqrstuvwxyz";
    scanf("%s %s", a, b);
    int len_a = strlen(a), len_b = strlen(b), i = 0, c[26] = { 0 }, j = 0, flag = 1, d[26] = { 0 };
    for (i = 0; i < len_a; i++)
    {
        for (j = 0; j < 26; j++)
        {
            if (a[i] == temp[j] || a[i] == temp[j] - 32)
            {
                c[j]++;
                break;
            }
        }
    }
    for (i = 0; i < len_b; i++)
    {
        for (j = 0; j < 26; j++)
        {
            if (b[i] == temp[j] || b[i] == temp[j] - 32)
            {
                d[j]++;
                break;
            }
        }
    }
    for (i = 0; i < 26; i++)
    {
        if (c[i] != d[i])
        {
            flag = 0;
            break;
        }
    }
    if (flag == 1)
        printf("Y\n");
    else
        printf("N\n");
    return 0;
}